package com.zz.dubbo.example.web;

import com.zz.dubbo.example.commons.resopnse.Response;
import com.zz.dubbo.example.model.City;
import com.zz.dubbo.example.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by zhouzeng on 2017/8/25.
 */
@Controller
public class CityController {
    @Autowired
    private CityService cityService;

    @RequestMapping("/hello")
    @ResponseBody
    public Response<List<City>> home() {
        Response<List<City>> response = cityService.list();
        System.out.println(response.getData().toString());
        return response;
    }
}
